<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <link rel="stylesheet" href="./bootstrap-3.3.7-dist/css/bootstrap.css">
        <script src="./jquery-3.2.1.js"></script>        
        <script src="./bootstrap-3.3.7-dist/js/bootstrap.js"></script>
    </head>
    <body>
      <a name="top" href="#"></a>
      <h1 class="text-center">统一建模语言理论测试</h1>
      <h1>分数: <span id="score"> </span></h1>
      
      <h3><div class="row">
          <div class="col-xs-12 col-sm-4">考试科目： 统一建模语言</div>
            <div class="col-xs-12 col-sm-4">时间： 100分钟</div>
              <div class="col-xs-12 col-sm-4">总分：100分</div>
            </div></h3>
      
      <div class="row">
        <div class="col-md-4">
           <input type="text" class="form-control" placeholder="班级" aria-describedby="basic-addon1">
        </div>
        <div class="col-md-4">
          <input type="text" class="form-control" placeholder="姓名" aria-describedby="basic-addon1">
        </div>
        <div class="col-md-4">
          <input type="text" class="form-control" placeholder="学号" aria-describedby="basic-addon1">
        </div>
      
      </div>
      <form id="myForm" method="" name="myForm" action="">
        
      <h2>一、填空题（每空5分，共20分）</h2>
      
      <div class="input-group">
          <span class="input-group-addon" id="basic-addon1">1.UML的中文全称是：</span>
          <div class="col-md-6">
          <input type="text" class="form-control" name="blank" id="blank" aria-describedby="basic-addon1"></div>
      </div>
      <div class="input-group">
          <span class="input-group-addon" id="basic-addon1">2.对象最突出的特征是：</span>
          <div class="row">
            <div class="col-md-2">
              <input type="text" class="form-control" name="blank1" id="blank1" aria-describedby="basic-addon1"></div>
            <div class="col-md-2">
              <input type="text" class="form-control" name="blank2" id="blank2" aria-describedby="basic-addon1"></div>
            <div class="col-md-2">
              <input type="text" class="form-control" name="blank3" id="blank3" aria-describedby="basic-addon1"></div>
          </div>
      </div>
  
      
      <h2>二、选择题（每题10分，共20分）</h2>
      
      <p>&nbsp;&nbsp;1.UML与软件工程的关系是：</p>
      
      <form>
      &nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" value="a" name="select1" id="1A"><label for="1A">(A) UML就是软件工程</label>
      <br>
       &nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" value="b" name="select1" id="1B"><label for="1B">(B) UML参与到软件工程中软件开发过程的几个阶段</label>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" value="c" name="select1" id="1C"><label for="1C">(C) UML与软件工程无关</label>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" value="d" name="select1" id="1D"><label for="1D">(D) UML是软件工程的一部分</label>
      </form> 
      
      <p>&nbsp;&nbsp;2.Java语言支持：</p>
      
      <form>
      &nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" value="a" name="select2" id="2A"><label for="2A">(A) 单继承</label>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" value="b" name="select2" id="2B"><label for="2B">(B) 多继承</label>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" value="c" name="select2" id="2C"><label for="2C">(C) 单继承和多继承都支持</label>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" value="d" name="select2" id="2D"><label for="2D">(D) 单继承和多继承都不支持</label>
      </form> 


  
      <h2>三、多择题（每题10分，共20分）</h2>
      
      <p>&nbsp;&nbsp;1.用例的粒度分为以下哪三种：</p>
      
      <form>
      
      &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="a" name="sselect1" id="3A"><label for="3A">(A) 概述级</label>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="b" name="sselect1" id="3B"><label for="3B">(B) 需求级</label>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="c" name="sselect1" id="3C"><label for="3C">(C) 用户目标级</label>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="d" name="sselect1" id="3D"><label for="3D">(D) 子功能级</label>
      </form> 
      
      <p>&nbsp;&nbsp;2.类图由以下哪三部分组成：</p>
      
      <form>
      
      &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="a" name="sselect2" id="4A"><label for="4A">(A) 名称(Name) </label>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="a" name="sselect2" id="4B"><label for="4B">(B) 属性(Attribute) </label>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="a" name="sselect2" id="4C"><label for="4C">(C) 操作(Operation)</label>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="a" name="sselect2" id="4D"><label for="4D">(D) 方法(Function)</label>
      </form> 

   
      <h2>四、判断题（每题10分，共20分）</h2>
      
      <p>&nbsp;&nbsp;1.用例图只是用于和客户交流和沟通的,用于确定需求。<form>
      
      <input type="radio" value="t" name="tfselect1" id="t1"><label for="t1">√</label>
      
      <input type="radio" value="f" name="tfselect1" id="f1"><label for="f1">×</label></form></p>
      
      <p>&nbsp;&nbsp;2.在状态图中,终止状态在一个状态图中允许有任意多个。<form>
      
      <input type="radio" value="t" name="tfselect2" id="t2"><label for="t2">√</label>
      
      <input type="radio" value="f" name="tfselect2" id="f2"><label for="f2">×</label></form></p>


      
      <h2>五、简答题（每题20分，共20分）</h2>
      
      <div class="panel panel-default">
          <div class="panel-heading">
              <label for="comments"><h3 class="panel-title">&nbsp;&nbsp;1.简述什么是模型以及模型的表现形式？</h3></label>
          </div>
          <div class="panel-body">
              <textarea name="comments" id="comments" cols="150" rows="5"></textarea>
              
              <!-- <input type="text" class="form-control" placeholder="模型是对现实世界的简化和抽象，模型是对所研究的系统、过程、事物或概念的一种表达形式。可以是物理实体；可以是某种图形；或者是一种数学表达式。" aria-describedby="sizing-addon1"> -->
          </div>
        </div>
        
        <br>

      <a href="#top" target="_self">
      <input type="submit" name="btnSubmit" id="btnSubmit" class="btnSubmit" value="计算分数">
      </a>
 
      </form>
      
      <script>
        
        let btn = document.getElementById("btnSubmit");
        btn.addEventListener("click",function (e) {
            e.preventDefault();
            let s = 0;
            let blank = document.getElementById("blank").value;
            if([blank].toString()=="统一建模语言"){
              s=s+5;
            }
            let blank1 = document.getElementById("blank1").value;
            if([blank1].toString()=="封装性"){
              s=s+5;
            }
            let blank2 = document.getElementById("blank2").value;
            if([blank2].toString()=="继承性"){
              s=s+5;
            }
            let blank3 = document.getElementById("blank3").value;
            if([blank3].toString()=="多态性"){
              s=s+5;
            }


            let radio1 = document.getElementsByName('select1');
            for(let i = 0; i<radio1.length; i++){
              if(radio1[i].checked&&radio1[i].value=="b"){
                  s=s+10;
              }
            }
            let radio2 = document.getElementsByName('select2');
            for(let i = 0; i<radio2.length; i++){
              if(radio2[i].checked&&radio2[i].value=="a"){
                  s=s+10;
              }
            }


            let arr1 = [];
            let checkbox1 = document.getElementsByName('sselect1');
            for(let i = 0; i<checkbox1.length;i++){
              if(checkbox1[i].checked){
                arr1.push(checkbox1[i].value);
                if(arr1.toString()=="a,b,d"){
                  s=s+10;
                }
              }
            }
            let arr2 = [];
            let checkbox2 = document.getElementsByName('sselect2');
            for(let i = 0; i<checkbox2.length;i++){
              if(checkbox2[i].checked){
                arr2.push(checkbox2[i].value);
                if(arr2.toString()=="a,b,c"){
                  s=s+10;
                }
              }
            }
        

            let tf1 = document.getElementsByName('tfselect1');
            for(let i = 0; i<tf1.length; i++){
              if(tf1[i].checked&&tf1[i].value=='f'){
                s=s+10;
              }
            }
            let tf2 = document.getElementsByName('tfselect2');
            for(let i = 0; i<tf2.length; i++){
              if(tf2[i].checked&&tf2[i].value=='t'){
                s=s+10;
              }
            }

            let texts = document.getElementById("comments").value;
            if([texts].toString()=="模型是对现实世界的简化和抽象，模型是对所研究的系统、过程、事物或概念的一种表达形式。可以是物理实体；可以是某种图形；或者是一种数学表达式。"){
              s=s+20;
            }
  
            let score = document.getElementById('score');
            score.innerHTML = s;
  
        });
    </script>
    </body>
</html>